﻿@model IEnumerable<HotelManageSystem.Models.ProductModel>
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutWarehouseInstall.cshtml";
}
@section Head
{
    <link href= "@Url.Content("~/Content/TelerikGrid.css")"rel="stylesheet" type="text/css" />
    
}
@{
    Html.Telerik()
        .Grid(Model)
        .Name("Grid")
        .DataKeys(keys => keys.Add(p => p.ID))
        .ToolBar(commands => commands.Insert())
        .DataBinding(dataBinding => dataBinding.Ajax()
                                        .Select("TelerikAjax", "Product")
                                        .Insert("Insert", "Product")
                                        .Update("Update", "Product")
                                        .Delete("Delete", "Product")
        )
        .Sortable()
        .Pageable()
        .Columns(columms =>
                     {
                         //columms.Bound(p => p.ID).Visible(false);
                         columms.Bound(p => p.Name).Title("货品名");
                         columms.Bound(p => p.ProductCategoy).Title("货品类别");
                         columms.Command(commands => commands.Edit());
                     }
        )
        .Editable(editing => editing.Mode(GridEditMode.PopUp))
        
        .Scrollable(scrolling => scrolling.Height(270))
        .Selectable()
        .Groupable()
        .Filterable()
        .Render();

}
